import Vue from 'vue'
import App from './App.vue'
import router from './router'
import './plugins/element.js'
import './assets/global.css'
import './assets/fonts/iconfont.css';
import axios from 'axios';
import TreeTable from 'vue-table-with-tree-grid';
import Moment from 'moment'
import VueQuillEditor from 'vue-quill-editor'
axios.defaults.baseURL = "http://127.0.0.1:8888/api/private/v1/"
axios.interceptors.request.use(config => {
  config.headers.Authorization = window.sessionStorage.getItem('token')
  return config

})
axios.interceptors.response.use(config => {
  const { data: res } = config
  return res

})
Vue.component('tree-table', TreeTable);

// require styles
import 'quill/dist/quill.core.css'
import 'quill/dist/quill.snow.css'
import 'quill/dist/quill.bubble.css'
// 富文本编辑器
Vue.use(VueQuillEditor);
// 全局时间格式化过滤器
Vue.filter('dateFormat', function (originVal) {
  return Moment(originVal).format('YYYY年MM月DD日 hh时mm分ss秒')
})
Vue.prototype.$http = axios;
Vue.config.productionTip = false
new Vue({
  router,
  render: h => h(App)
}).$mount('#app')
